// ES6语法

let count = 0
const add = function (a, b) {
  console.log('adddddd')
  count += 1
  return a + b
}
const sqrt = (q) => {
  return Math.sqrt(q)
}

const testArrayIncludes = () => {
  const arr = [1, 2, 3].map(item => item * 2)
  return arr.includes(6)
}

const testPromise = async () => {
  const reslut = await new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve('str from testPromise')// 修改promise的状态为fullfilled
    }, 3000)
  })
  console.log('testPromise', reslut)
}

export { count, add, sqrt, testArrayIncludes, testPromise }
